home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1599 / 1444 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.7 KB

  1. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  2. Date: Tue, 24 May 94 11:37:57 +0200
  3. Message-Id: <9405240937.AA27394@issan.informatik.uni-dortmund.de>
  4. To: mint@atari.archive.umich.edu
  5. Subject: MiNTlib: adding strcasecmp and strncasecmp
  6.  
  7. This patch adds the functions strcasecmp and strncasecmp, typically
  8. found on BSD systems, to the MiNTlib.  Actually, they are already
  9. there, only misnamed :-).
  10.  
  11. *** orig/stricmp.c    Thu Sep 17 12:48:28 1992
  12. --- stricmp.c    Mon May 23 14:26:24 1994
  13. ***************
  14. *** 13,18 ****
  15. --- 13,19 ----
  16.   
  17.   #ifdef __GNUC__
  18.   asm(".stabs \"_strcmpi\",5,0,0,_stricmp"); /* dept of clean tricks */
  19. + asm(".stabs \"_strcasecmp\",5,0,0,_stricmp");
  20.   #endif
  21.   
  22.   int                             /* <0 for <, 0 for ==, >0 for > */
  23. ***************
  24. *** 49,54 ****
  25. --- 50,63 ----
  26.   #ifndef __GNUC__
  27.   int
  28.   strcmpi(scan1, scan2)
  29. + register const char *scan1;
  30. + register const char *scan2;
  31. + {
  32. +     return stricmp(scan1, scan2);
  33. + }
  34. + int
  35. + strcasecmp(scan1, scan2)
  36.   register const char *scan1;
  37.   register const char *scan2;
  38.   {
  39. *** orig/strnicmp.c    Thu Sep 17 12:48:32 1992
  40. --- strnicmp.c    Mon May 23 14:28:04 1994
  41. ***************
  42. *** 13,18 ****
  43. --- 13,19 ----
  44.   
  45.   #ifdef __GNUC__
  46.   asm(".stabs \"_strncmpi\",5,0,0,_strnicmp"); /* dept of clean tricks */
  47. + asm(".stabs \"_strncasecmp\",5,0,0,_strnicmp");
  48.   #endif
  49.   
  50.   int                             /* <0 for <, 0 for ==, >0 for > */
  51. ***************
  52. *** 55,60 ****
  53. --- 56,70 ----
  54.   #ifndef __GNUC__
  55.   int
  56.   strncmpi(scan1, scan2, n)
  57. + register const char *scan1;
  58. + register const char *scan2;
  59. + size_t n;
  60. + {
  61. +     return strnicmp(scan1, scan2, n);
  62. + }
  63. + int
  64. + strncasecmp(scan1, scan2, n)
  65.   register const char *scan1;
  66.   register const char *scan2;
  67.   size_t n;
  68.